/**
 * 动态路由
 */
import type { RouteRecordRaw } from 'vue-router'

export const dynamicRoutes: RouteRecordRaw[] = [
  {
    path: "/",
    name: 'Layout',
    component: () => import("@/layouts/index.vue"),
    redirect: '/home',
    children: [
      {
        path: "/home",
        name: 'Home',
        component: () => import("@/views/home/index.vue"),
        meta: {
          title: '首页',
          icon: 'ele-HomeFilled',
          hidden: false,
          isBreadcrumd: true,
        }
      },
      {
        path: "/system",
        name: 'System',
        redirect: '/system/menu',
        meta: {
          title: '系统管理',
          icon: 'ele-Setting',
          isBreadcrumd: true,
        },
        children: [
          {
            path: "/system/menu",
            name: 'SystemMenu',
            component: () => import('@/views/system/menu/index.vue'),
            meta: {
              title: '菜单管理',
              icon: 'ele-Menu',
              cache: true,
              hidden: false,
              isBreadcrumd: true,
            }
          },
          {
            path: "/system/role",
            name: 'SystemRole',
            component: () => import('@/views/system/role/index.vue'),
            meta: {
              title: '角色管理',
              icon: 'ele-IceCream',
              cache: true,
              hidden: false,
              isBreadcrumd: true,
            }
          },
          {
            path: "/system/user",
            name: 'SystemUser',
            component: () => import('@/views/system/user/index.vue'),
            meta: {
              title: '用户管理',
              icon: 'ele-User',
              cache: true,
              hidden: false,
              isBreadcrumd: true,
            }
          },
        ]
      },
      {
        path: "/goods",
        name: 'Goods',
        redirect: '/goods/list',
        meta: {
          title: '商品管理',
          icon: 'ele-Undefine',
          isBreadcrumd: true,
        },
        children: [
          {
            path: "/goods/list",
            name: 'GoodsList',
            component: () => import('@/views/goods/list.vue'),
            meta: {
              title: '商品列表',
              icon: 'ele-Undefine',
              cache: true,
              hidden: false,
              isBreadcrumd: true,
            }
          },
          {
            path: "/goods/category",
            name: 'GoodsCategory',
            component: () => import('@/views/goods/category.vue'),
            meta: {
              title: '商品分类',
              icon: 'ele-Undefine',
              cache: true,
              hidden: false,
              isBreadcrumd: true,
            }
          },
        ]
      },
      {
        path: "/hsxp",
        name: 'Hsxp',
        component: () => import("@/views/link/index.vue"),
        meta: {
          title: 'xxx官网',
          icon: 'ele-Link',
          cache: false,
          isBreadcrumd: true,
          linkTo: 'https://www.hsxp-hk.com/',
        }
      },
      // {
      //   path: "/401",
      //   name: 'NoPermission',
      //   component: () => import("@/views/error/401.vue"),
      //   meta: {
      //     title: '401页面',
      //     icon: 'ele-Undefine',
      //     cache: true,
      //     hidden: false,
      //     isBreadcrumd: true,
      //   }
      // },
      // {
      //   path: "/:path(.*)", // 404匹配上面未找到的路由
      //   name: 'NoFound',
      //   component: () => import("@/views/error/404.vue"),
      //   meta: {
      //     title: '为找到该页面',
      //     cache: true,
      //     hidden: true,
      //   }
      // },
    ]
  },
]